package com.springioc.controller;

import com.springioc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
   //属性注入
    /*@Autowired*/
    private UserService userService;//声明
//    @Autowired
     public UserController() {
   }
    @Autowired
    public UserController(UserService userService) {
        this.userService = userService;
    }
    public void sayHi(){
        System.out.println("Hi,UserController...");
        userService.HiSay();
    }
//
//    public void setUserService(UserService userService) {
//        this.userService = userService;
//    }

}
